using AutojsController.Services;
using AutojsController.ViewModels;
using Avalonia.Controls;
using SukiUI.Controls;
using System.Linq;

namespace AutojsController.Views
{
    public partial class MainWindow : SukiWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void SukiSideMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var mobvm = ((SukiSideMenu)sender).Items.OfType<MobileViewModel>().FirstOrDefault();
            if(mobvm is MobileViewModel)
            {
                foreach (var mob in mobvm.Mobiles)
                    mob.IsSelected = false;
            }
        }
    }
}